#pragma once

#include "../../plugin/base/framework.hh"
#include "../../corelib/singleton.hpp"

// User implemented framework
// @see Framework
class Example_serviceFramework : public Framework {
    virtual ModuleType onModuleType() override {
        return ModuleType::SERVICE_MODULE;
    }
    // TODO
    virtual bool onInstall(kconfig::Config* config) override;
    virtual bool onUninstall() override;
    virtual bool onStart(kconfig::Config* config) override;
};

// singleton of user framework
// NOTICE the name 'FrameworkRef' MUST NOT change
#define FrameworkRef (*kratos::corelib::Singleton<Example_serviceFramework>::instance())
#define FrameworkSingleton kratos::corelib::Singleton<Example_serviceFramework>

#ifdef verblog
#undef verblog
#define verblog (ModuleRef.getLogverb() << "[example_service]")
#endif // verblog
#ifdef debuglog
#undef debuglog
#define debuglog (ModuleRef.getLogdebug() << "[example_service]")
#endif // debuglog
#ifdef warnlog
#undef warnlog
#define warnlog (ModuleRef.getLogwarn() << "[example_service]")
#endif // warnlog
#ifdef errorlog
#undef errorlog
#define errorlog (ModuleRef.getLogerror() << "[example_service]")
#endif // errorlog
#ifdef fatallog
#undef fatallog
#define fatallog (ModuleRef.getLogfatal() << "[example_service]")
#endif // fatallog
#define endlog (ModuleRef.getLogend())
